﻿<Window x:Class="SwiftTailer.Wpf.Pages.LogPicker"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:viewModels="clr-namespace:SwiftTailer.Wpf.ViewModels"
        mc:Ignorable="d"
        x:Name="DialogWindow"
        Title="Add a log to group" MinHeight="171.656" MinWidth="546" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" SizeToContent="WidthAndHeight">
    <Window.DataContext>
        <viewModels:LogPickerDialogViewModel />
    </Window.DataContext>
    <Window.Resources>
        <Style TargetType="Button" x:Key="ActionButtons">
            <Setter Property="Margin" Value="5 0" />
            <Setter Property="Width" Value="100"></Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <DockPanel LastChildFill="True" Margin="5 0">
            <TextBlock Text="Adding to: " VerticalAlignment="Center"/>
            <TextBlock Text="{Binding SelectedGroup.Name}" VerticalAlignment="Center" />
        </DockPanel>
        <DockPanel LastChildFill="True" Grid.Row="1" Margin="5" Grid.ColumnSpan="2">
            <Button Content="Choose..." Command="{Binding PickLogCommand}" Margin="0 0 5 0" Width="75"/>
            <TextBox Text="{Binding FileLocation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
        </DockPanel>
        <DockPanel Grid.Row="2" LastChildFill="True">
            <TextBlock Text="Alias" VerticalAlignment="Center" Margin="5 0 0 0" Width="75"/>
            <TextBox Text="{Binding Alias, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="5"/>
        </DockPanel>
        <StackPanel Orientation="Horizontal" Grid.Row="3" Margin="0,20,5,5" HorizontalAlignment="Right" Grid.ColumnSpan="2">
            <Button Content="Save" Style="{StaticResource ActionButtons}" Command="{Binding SaveLogToGroupCommand}" CommandParameter="{Binding ElementName=DialogWindow}" IsDefault="True"/>
            <Button Content="Cancel" Style="{StaticResource ActionButtons}" Command="{Binding CloseWindowCommand}" CommandParameter="{Binding ElementName=DialogWindow}" IsCancel="True"/>
        </StackPanel>
    </Grid>
</Window>
